Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a solution for #121. I needed this myself while running some perf tests this week, so I took the opportunity to patch the gem, clean up and add tests.
I also had to find a way to set the
Content-Type
header, because the request I was testing was a JSON request and the gem did not support setting that header throughHTTP_
variables (looks like it's a restriction from Rack, actually).Another thing I had to do was disable the CSRF protection before initializing the app. I did that because non-GET requests require an authenticity token and I couldn't find a way to generate a valid one from the
Rails.application
context. I'm open to suggestions.I really appreciate the work you've done with this gem @schneems (and everyone else who has contributed), it has helped me so much to investigate and find the memory leaks. It felt like I had everything I needed in a single tool. 🙂👏